package crudfx.sound;
/**
 * <p>Chord of instruments and drums</p>
 * <p><b>Example</b>
 * <i>Play La major and drum</i></p>
 * <pre>
package testbox;

import javafx.stage.*;
import javafx.scene.*;
import crudfx.control.*;
import crudfx.interop.*;
import crudfx.sound.*;

Stage{
    width:400
    height:400
    scene:Scene{
        content:UINode{
            content:StandardButton{
                text:"Play"
                action:function():Void{
                    Chord{
                        part:2
                        voices:[
                            Voice{part:2 instrument:24 pitch:57 velocity:1}
                            ,Voice{part:2 instrument:24 pitch:61 velocity:1}
                            ,Voice{part:2 instrument:24 pitch:64 velocity:1}
                            ]
                        drums:[
                            Drum{part:2 instrument:35 velocity:1}
                            ,Drum{part:2 instrument:49 velocity:1}
                            ]
                        }.play(120);
                    }
                }
            }
        }
    }
 </pre>
 * @profile desktop
 * @author Sergey Surikov
 */
public class Chord {
    /**
    Array of voices
    */
    public var voices:Voice[];
    /**
    Array of drums
    */
    public var drums:Drum[];
    /**
    Part of whole note ie 16=sixteenth note
    */
    public var part:Number;
    /**
    Play
    */
    public function play(playTempo:Number):Void{
        for(i in voices)i.play(playTempo);
        for(i in drums)i.play(playTempo);
        }
}
